function dow1(obj){
        var DowW = parseInt(obj.width()); 
        var DowWl = parseInt(obj.find('.form-groupal').width());
        obj.find('.form-groupar').width(DowW-DowWl-1);
        obj.find('.form-groupar').find('input').width(DowW-DowWl-27);
         obj.find('.form-groupar').find('textarea').width(DowW-DowWl-27);
      }
       function dow(obj){
        var DowW = parseInt(obj.width()); 
        var DowWl = parseInt(obj.find('.form-groupal').width())*2;
        var DowZ=(DowW-DowWl)/2;
        obj.find('.form-groupar').width(DowZ-1);
        obj.find('.form-groupar').find('input').width(DowZ-27);
         obj.find('.form-groupar').find('textarea').width(DowW-DowWl-27);
      }


      dow1($(".form-groupa"));
      dow($(".form-groupb"));

      $(window).on("resize",function(){
        dow1($(".form-groupa"));
        dow($(".form-groupb"));
      });


      var arr =[];
      arr = $(".form-group");
      var xxx =1000;
      var len = arr.length;
      for(var i=0;i<len;i++){
        xxx--;
        $(arr[i]).css({"z-index":xxx});
      }

      /*
      function showexam(obj){
      var href = $(obj).data("src");
      var html = "<iframe id='frames' src='"+href+"'  style='position:absolute;width:100%;height:100%;top:0;left:0'/>";
      document.getElementById("contentbox").innerHTML = html;
    }
    */


      /*oSelect.onchange = function () { 
        var text=oSelect.options[oSelect.selectedIndex].text; 
        curSelect.innerHTML = text; 
      }*/
//全选
$(".quanxuan-input").on("click",function(){
	if(!$(this).children("input").prop("checked")){
		$("input[type='checkbox']").prop("checked","checked");
	}else{
		$("input[type='checkbox']").prop("checked",false);
	}
})
//兼容类名
var queryByClass = function(clazz){
    if(!!document.querySelectorAll){
        return document.querySelectorAll("." + clazz); 
    }else if(!!document.getElementsByClassName){
        return document.getElementsByClassName(clazz);
    }else{
        var arr = [], reg = new RegExp("(\\s" + clazz + "\\s*$|^\\s*" + clazz + "\\s|^\\s*" + clazz + "\\s*$|\\s"+clazz+"\\s)");
        var doms = document.getElementsByTagName("*");
        for(var i = 0; i < doms.length; i++){
            var di = doms[i];
            if(
            di.className.search(reg) != -1
            || 
            !!di.getAttributeNode 
            &&
            !!di.getAttributeNode("class") 
            && di.getAttributeNode("class").value.search(reg) != -1
            ||
            !!di.getAttribute
            &&
                 di.getAttribute("classname").search(reg) != -1
            ||
                 !!di.classList && di.classList.contains(clazz)
            ){
                arr.push(di);
            }
        }
        return arr;
    }
};
var xuanzhong=queryByClass("xuanzhong");
$(".xuanzhong").each(function(index,el){
	$(el).click(function(){
		var falg=false;
		for(var i=0;i<xuanzhong.length;i++){
			if($(xuanzhong[i]).prop("checked")){
				falg=true;
			}else{
				falg=false;
				break;
			}
		}
		if(falg){
				$("#quanxuan").prop("checked","checked");
			}else{
				$("#quanxuan").prop("checked",false);
			}
	})
})
$("#quanxuan").on("click",function(){
	if($(this).prop("checked")){
		$(".xuanzhong").prop("checked","checked");
	}else{
		$(".xuanzhong").prop("checked",false);
	}
})
//默认时间
      Date.prototype.Format = function(fmt)   
{ //author: meizz   
  var o = {   
    "M+" : this.getMonth()+1,                 //月份   
    "d+" : this.getDate(),                    //日   
    "h+" : this.getHours(),                   //小时   
    "m+" : this.getMinutes(),                 //分   
    "s+" : this.getSeconds(),                 //秒   
    "q+" : Math.floor((this.getMonth()+3)/3), //季度   
    "S"  : this.getMilliseconds()             //毫秒   
  };   
  if(/(y+)/.test(fmt))   
    fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));   
  for(var k in o)   
    if(new RegExp("("+ k +")").test(fmt))   
  fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));   
  return fmt;   
} 
//var time1 = new Date().Format("yyyy-MM-dd hh:mm:ss");     
  
var time2 = new Date().Format("yyyy-MM-dd");  
 document.getElementById("c3").value= time2;
 document.getElementById("c4").value= time2;
 if(document.getElementById("c3")!=undefined || document.getElementById("c4") !=undefined){
 	document.getElementById("c3").value= time2;
 	document.getElementById("c4").value= time2;
 }